/**    
 * 文件名：BaseController.java    
 *    
 * 版本信息：    
 * 日期：2013-3-30    
 * Copyright 足下 Corporation 2013     
 * 版权所有    
 *    
 */
package com.jerry.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jerry.exception.BzException;
import com.jerry.service.IEmployeeService;

/**    
 *     
 * 项目名称：SpringMVC    
 * 类名称：BaseController    
 * 类描述：    控制器基类
 * 创建人：Administrator    
 * 创建时间：2013-3-30 下午4:17:22    
 * 修改人：Administrator    
 * 修改时间：2013-3-30 下午4:17:22    
 * 修改备注：    
 * @version     
 *     
 */


@Controller
public class BaseController {

	/**log4j**/
	static Logger logger = null;
	
	@Resource(name = "employeeService")
	private IEmployeeService employeeService;
	
	public IEmployeeService getEmployeeService() {
		return employeeService;
	}
	
	public BaseController(){
		logger = Logger.getLogger(getClass().getName());
	}
	
	@RequestMapping(value = "/index.do",method = RequestMethod.GET)
	public String welcome(){
		try {
			getEmployeeService().getAllEmployees();
		} catch (BzException e) {
			e.printStackTrace();
			
		}
		return "base/main";
	}
}
